<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="fragments :: head(title=~{::title/text()})">
    <title>Messages : View all</title>
</head>
<body>
<div class="container">
    <div th:replace="fragments :: navbar"></div>
    <div class="float-right mt-2">
        <a class="btn btn-primary btn-sm" href="form.html" th:href="@{/(form)}">Create Message</a>
    </div>
    <h4 class="float-left mt-2">Messages : View all</h4>
    <table class="table table-bordered table-striped">
        <thead>
        <tr>
            <th>ID</th>
            <th>Created</th>
            <th>Summary</th>
        </tr>
        </thead>
        <tbody>
        <tr th:if="${messages.empty}">
            <td colspan="3">No messages</td>
        </tr>
        <tr th:each="message : ${messages}">
            <td th:text="${message.id}">1</td>
            <td th:text="${#calendars.format(message.created)}">July 11,
                2012 2:17:16 PM CDT
            </td>
            <td><a href="view.html" th:href="@{'/' + ${message.id}}"
                   th:text="${message.summary}"> The summary </a></td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>
